package cn.changgou.user.feign;

import cn.changgou.entity.Result;
import cn.changgou.user.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "user")
@RequestMapping(value = "/user")
public interface UserFeign {

    /*根据ID查询用户信息*/
    @GetMapping("/load/{id}")
    Result<User> findById(@PathVariable String id);

    @GetMapping(value = "/points/add")
    public Result addPoints(@RequestParam(value = "points") Integer points,
                            @RequestParam(value = "username") String username);
}
